<?php
//引入数据库连接文件
include_once("../common/config.php");
//判断是否有数据提交
if (isset($_POST['submit']))
{
    //获取表单提交的数据
	$content = addslashes(trim($_POST['content']));
    $sort_id = addslashes(trim($_POST['sort']));
	$predicate = addslashes(trim($_POST['predicate']));
    $is_top = addslashes(trim($_POST['istop']));
    $is_notice = addslashes(trim($_POST['isnotice']));
	//构建插入语句
    $sql = "INSERT INTO twitter (t_content,t_predicate,s_id,is_top,is_notice,t_time) VALUES ('$content','$predicate','$sort_id','$is_top','$is_notice',now())";
	//判断是否插入成功
	$result = mysql_query("$sql") or die("插入数据失败" . mysql_error());
}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>foxke微博系统——后台管理之发表微博</title>
<link href="style/css.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="editor/jquery/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="editor/xheditor-zh-cn.min.js"></script>
</head>
<body>
<div id="wrap">
  <?php include_once("header.php");?>
  <div id="PassHead">
    <table width="100%" border="0" cellspacing="0" cellpadding="1" style="border-color:#CCCCCC" >
      <form id="form1" name="form1" method="post" action="">
        <tr>
          <td height="30" colspan="4" align="center" bgcolor="#eeeeee" class="Title">发表文章</td>
        </tr>
        <tr>
          <td width="75" height="35" align="left">微博分类：</td>
          <td width="200" align="left"><select name="sort" class="YanSe" id="sort">
            <option value="1">读书文摘</option>
            <option value="2">网络段子</option>
            </select>
          </td>
          <td width="75" align="left">谓语动词：</td>
          <td width="446" align="left"><select name="predicate" class="YanSe" id="predicate">
              <option value="asks" style="background-color:#8361bc">提问</option>
              <option value="feels" style="background-color:#2d83be">感觉</option>
              <option value="has" style="background-color:#777">有</option>
              <option value="hates" style="background-color:#333">讨厌</option>
              <option value="hopes" style="background-color:#5bb017">希望</option>
              <option value="is" style="background-color:#e57c43">背景样式(6)</option>
              <option value="likes" style="background-color:#cb2728">背景样式(7)</option>
              <option value="loves" style="background-color:#c20c0c">背景样式(8)</option>
              <option value="needs" style="background-color:#479e80">背景样式(9)</option>
              <option value="say" style="background-color:#e2560b">背景样式(10)</option>
              <option value="shares" style="background-color:#c95e7c">背景样式(11)</option>
              <option value="thinks" style="background-color:#538fa0">背景样式(12)</option>
              <option value="wants" style="background-color:#8db241">背景样式(13)</option>
              <option value="was" style="background-color:#a47e5f">背景样式(14)</option>
              <option value="will" style="background-color:#b46db9">背景样式(15)</option>
              <option value="wonders" style="background-color:#2e4e9e">背景样式(16)</option>
            </select>
          </td>
        </tr>
        <tr>
          <td height="35" align="right">是否置顶：</td>
          <td align="left"><input name="istop" type="checkbox" id="istop" value="checkbox" /></td>
          <td align="left">是否公告：</td>
          <td align="left"><input name="isnotice" type="checkbox" id="isnotice" value="checkbox" /></td>
        </tr>
        <tr>
          <td height="45" align="right" valign="top">内容：</td>
          <td colspan="3" align="left"><textarea name="content" id="content"  class="xheditor {skin:'o2007blue',width:'720',height:'200'}"></textarea></td>
        </tr>
        <tr>
          <td height="45" align="right"></td>
          <td colspan="3" align="left" valign="bottom"><input name="submit" type="submit" class="anniu" id="submit" value="确定/提交" />
            <input name="return" type="reset" class="anniu" id="return" onclick="history.go(-1)" value="取消/返回" />
          </td>
        </tr>
      </form>
    </table>
  </div>
  <!---content end--->
  <?php include_once("footer.php");?>
